home *** CD-ROM | disk | FTP | other *** search
/ USGS: Oil & Gas Fields of Asia Pacific / USGS Maps Showing Geology, Oil & Gas Fields of Asia Pacific.iso / pc / ASPAC / VIEWS03 / SCRIPTS / ZMOUTTOL.AVE < prev    next >
Text File  |  1999-03-10  |  3KB  |  108 lines

  1. ' zmouttol.ave
  2. ' Integrates Arcview View.ZoomOut.Tool script
  3. ' to label geology on the fly
  4. ' D.W. Steinshouer - GeoLukas for U.S.G.S. GEO CERT WEP
  5. ' World Energy Project
  6. ' Thomas Ahlbrandt   Project Chief
  7.  
  8.  
  9. region3 = av.GetProject
  10. region3.SetModified(true)
  11. theView = av.GetActiveDoc
  12. r = theView.ReturnUserRect
  13. d = theView.GetDisplay
  14. if (r.IsNull.not) then
  15.   ext = d.ReturnExtent
  16.   ext.Scale(ext.GetWidth / r.GetWidth)
  17.   d.ZoomToRect(ext)
  18. else
  19.   d.ZoomOut(125)
  20.   d.PanTo(d.ReturnUserPoint)
  21. end
  22.  
  23. leg = region3.FindDoc("Geologic Legend")
  24. if (theView <> leg) then
  25.  
  26. ' geolabel.ave
  27. ' labels geology at scale > 1:10000000
  28. ' Douglas Steinshouer   11/14/98
  29. ' GeoLukas for USGS 
  30. ' World Energy Project
  31.  
  32. ' Defines the theme and clears existing labels
  33.  
  34. av.ShowMsg("Labeling geologic age ...")
  35. av.ShowStopButton
  36. av.SetStatus(0)
  37.  
  38. theView = av.GetActiveDoc
  39. theTheme = theView.GetThemes.Get(5)
  40. theTheme.SetActive(true)
  41. theTheme.GetGraphics.SelectLabels
  42. theTheme.GetGraphics.Invalidate
  43. theView.GetGraphics.ClearSelected
  44.  
  45. ' Determines scale of zoomed view
  46.  
  47. size = theView.GetDisplay.ReturnVisExtent
  48. tall = size.GetHeight
  49. long = size.GetWidth
  50.  
  51. ' Filters scale and draws labels
  52.  
  53.  if ((tall < 889000) AND (long < 1227670)) then
  54.    agelabel = Labeler.Make(size)
  55.    ' agelabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  56.    ' agelabel.SetLabelWeight(#LABEL_WEIGHT_HIGH)    
  57.    agesymbol = TextSymbol.Make
  58.    agesymbol.SetFont(Font.Make("Univers","Medium"))
  59.     if ((tall < 44450) AND (long < 61383)) then
  60.       agesymbol.SetSize(15)
  61.     elseif ((tall < 88900) AND (long < 122767)) then
  62.       agesymbol.SetSize(12)
  63.     elseif ((tall < 222250) AND (long < 306917)) then
  64.       agesymbol.SetSize(11)
  65.     elseif ((tall < 444500) AND (long < 613835)) then
  66.       agesymbol.SetSize(10)
  67.     elseif ((tall < 666751) AND (long < 920752)) then
  68.       agesymbol.SetSize(9)
  69.     else     
  70.       agesymbol.SetSize(8)
  71.     end
  72.    theTheme.SetLabelTextSym(agesymbol)
  73.    agelabel.Load(theTheme)
  74.    theView.GetAutoLabels(agelabel,true)
  75.  else
  76.    theTheme.GetGraphics.SelectLabels
  77.    theTheme.GetGraphics.Invalidate
  78.    theView.GetGraphics.ClearSelected
  79.  end
  80.  
  81.  
  82.  
  83. t2 = theView.GetThemes.Get(0)
  84. t2.SetActive(true)
  85. t2.GetGraphics.SelectLabels
  86. t2.GetGraphics.Invalidate
  87. theView.GetGraphics.ClearSelected
  88.  
  89. citylabel = Labeler.Make(size)
  90. citylabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  91. citylabel.SetLabelWeight(#LABEL_WEIGHT_HIGH)    
  92. citysymbol = TextSymbol.Make
  93. citysymbol.SetFont(Font.Make("Univers","Italic"))
  94. citysymbol.SetSize(10)
  95. t2.SetLabelTextSym(citysymbol)
  96. citylabel.Load(t2)
  97. theView.GetAutoLabels(citylabel,true)
  98.  
  99. ts = theView.GetThemes
  100.   for each t in ts
  101.     t.SetActive(false)
  102.   end
  103.  
  104. av.SetStatus(100)
  105. av.ClearMsg
  106.  
  107. end
  108.